package com.ruoyi.rural.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rural.mapper.RuralVirusPreventionMaterialsMapper;
import com.ruoyi.rural.domain.RuralVirusPreventionMaterials;
import com.ruoyi.rural.service.IRuralVirusPreventionMaterialsService;

/**
 * 防疫物资管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-17
 */
@Service
public class RuralVirusPreventionMaterialsServiceImpl implements IRuralVirusPreventionMaterialsService 
{
    @Autowired
    private RuralVirusPreventionMaterialsMapper ruralVirusPreventionMaterialsMapper;

    /**
     * 查询防疫物资管理
     * 
     * @param id 防疫物资管理主键
     * @return 防疫物资管理
     */
    @Override
    public RuralVirusPreventionMaterials selectRuralVirusPreventionMaterialsById(String id)
    {
        return ruralVirusPreventionMaterialsMapper.selectRuralVirusPreventionMaterialsById(id);
    }

    /**
     * 查询防疫物资管理列表
     * 
     * @param ruralVirusPreventionMaterials 防疫物资管理
     * @return 防疫物资管理
     */
    @Override
    public List<RuralVirusPreventionMaterials> selectRuralVirusPreventionMaterialsList(RuralVirusPreventionMaterials ruralVirusPreventionMaterials)
    {
        return ruralVirusPreventionMaterialsMapper.selectRuralVirusPreventionMaterialsList(ruralVirusPreventionMaterials);
    }

    /**
     * 新增防疫物资管理
     * 
     * @param ruralVirusPreventionMaterials 防疫物资管理
     * @return 结果
     */
    @Override
    public int insertRuralVirusPreventionMaterials(RuralVirusPreventionMaterials ruralVirusPreventionMaterials)
    {
        ruralVirusPreventionMaterials.setId(UUID.randomUUID().toString());
        ruralVirusPreventionMaterials.setCreateTime(DateUtils.getNowDate());
        return ruralVirusPreventionMaterialsMapper.insertRuralVirusPreventionMaterials(ruralVirusPreventionMaterials);
    }

    /**
     * 修改防疫物资管理
     * 
     * @param ruralVirusPreventionMaterials 防疫物资管理
     * @return 结果
     */
    @Override
    public int updateRuralVirusPreventionMaterials(RuralVirusPreventionMaterials ruralVirusPreventionMaterials)
    {
        ruralVirusPreventionMaterials.setUpdateTime(DateUtils.getNowDate());
        return ruralVirusPreventionMaterialsMapper.updateRuralVirusPreventionMaterials(ruralVirusPreventionMaterials);
    }

    /**
     * 批量删除防疫物资管理
     * 
     * @param ids 需要删除的防疫物资管理主键
     * @return 结果
     */
    @Override
    public int deleteRuralVirusPreventionMaterialsByIds(String[] ids)
    {
        return ruralVirusPreventionMaterialsMapper.deleteRuralVirusPreventionMaterialsByIds(ids);
    }

    /**
     * 删除防疫物资管理信息
     * 
     * @param id 防疫物资管理主键
     * @return 结果
     */
    @Override
    public int deleteRuralVirusPreventionMaterialsById(String id)
    {
        return ruralVirusPreventionMaterialsMapper.deleteRuralVirusPreventionMaterialsById(id);
    }
}
